<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		#box{
			width: 200px;
			height: 200px;
			background: red url() 0 0 no-repeat;
			font-size: 50px;
			line-height: 200px;
			text-align: center;
			color: #fff;
			position: absolute;
			top: 0px;
			left: 0px;
		}
	</style>
	<script type="text/javascript">
		window.onload= function () {
			box = document.getElementById('box');

			// is =true;
			box.onmouseover = function () {
				top1 = Math.ceil(Math.random()*500);
				left = Math.ceil(Math.random()*1000);

				box.style.top = top1+"px";
				box.style.left = left +"px";
				// if(is){
				// 	box.style.left = "800px";
				// 	is=false;
				// }else{
				// 	box.style.left = "0px";
				// 	is=true;
				// }
				
			}

			// num = 10;

			// function run() {
			// 	if(num==-1){
			// 		alert("时间到");
			// 		clearInterval(time);
			// 	}else{
			// 		box.innerHTML = num;
			// 		num--;
			// 	}
			// }

			// time = setInterval(run,1000);

			// box.onmouseover=function () {
			// 	clearInterval(time);
			// }

			// box.onmouseout=function () {
			// 	time = setInterval(run,1000);
			// }
		}
	</script>
</head>
<body>
	<div id="box">60</div>
</body>
</html>